<?php



namespace App\Http\Requests\Company;


use Carbon\Carbon;
use Illuminate\Support\Facades\Auth;

class AccountRequest extends BaseRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'name' => 'required|max:10',

        ];
    }

    public function messages()
    {
        return [
            'name.required' => __('请输入试题的标题'),

        ];
    }

    public function filldata()
    {
        return [
            'company_id'=>Auth::user()->login_company_id,
            'name' =>(string) $this->input('name', ''),
            'type' =>(string) $this->input('type', ''),
            'account'=>(int)$this->input('account',0),
            'address'=>(string)$this->input('address',''),
            'is_default'=>(int)$this->input('is_default',0)

        ];
    }
}
